package com.service.registerService.impl;

import com.service.registerService.service.RegisterService;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by CHUMI on 2017/9/1.
 */
@Service
@Transactional
public class RegisterImpl  implements RegisterService{
    //注入sql session
    @Autowired
    private SqlSessionFactory sqlSessionFactory;

    public void save(String name, String Password) {
        Map<String,String> pmap=new HashMap<String, String>();
        pmap.put("userName",name);
        pmap.put("password",Password);
        sqlSessionFactory.openSession().insert("User.save",pmap);
    }
}
